using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using Hardcodet.Wpf.TaskbarNotification;
using Hardcodet.Wpf.TaskbarNotification.Interop;
using ns1;

namespace ns0
{
	internal static class Class3
	{
		public static readonly object object_0;

		private static readonly bool bool_0;

		public static bool Boolean_0 => bool_0;

		static Class3()
		{
			object_0 = new object();
			bool_0 = (bool)DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement)).Metadata.DefaultValue;
		}

		public static Window smethod_0()
		{
			return new Window
			{
				Width = 0.0,
				Height = 0.0,
				ShowInTaskbar = false,
				WindowStyle = WindowStyle.None,
				AllowsTransparency = true,
				Opacity = 0.0
			};
		}

		public static bool smethod_1(ref NotifyIconData notifyIconData_0, NotifyCommand notifyCommand_0)
		{
			return smethod_2(ref notifyIconData_0, notifyCommand_0, notifyIconData_0.ValidMembers);
		}

		public static bool smethod_2(ref NotifyIconData notifyIconData_0, NotifyCommand notifyCommand_0, IconDataMembers iconDataMembers_0)
		{
			if (Boolean_0)
			{
				return true;
			}
			notifyIconData_0.ValidMembers = iconDataMembers_0;
			lock (object_0)
			{
				return Class5.Shell_NotifyIcon(notifyCommand_0, ref notifyIconData_0);
			}
		}

		public static BalloonFlags smethod_3(this BalloonIcon balloonIcon_0)
		{
			return balloonIcon_0 switch
			{
				BalloonIcon.None => BalloonFlags.None, 
				BalloonIcon.Info => BalloonFlags.Info, 
				BalloonIcon.Warning => BalloonFlags.Warning, 
				BalloonIcon.Error => BalloonFlags.Error, 
				_ => throw new ArgumentOutOfRangeException("icon"), 
			};
		}

		public static Icon smethod_4(this ImageSource imageSource_0)
		{
			if (imageSource_0 == null)
			{
				return null;
			}
			return new Icon((Application.GetResourceStream(new Uri(imageSource_0.ToString())) ?? throw new ArgumentException($"The supplied image source '{imageSource_0}' could not be resolved.")).Stream);
		}

		public static bool smethod_5<T>(this T gparam_0, params T[] gparam_1)
		{
			if (gparam_1 == null)
			{
				return false;
			}
			int num = 0;
			while (true)
			{
				if (num < gparam_1.Length)
				{
					T val = gparam_1[num];
					if (gparam_0.Equals(val))
					{
						break;
					}
					num++;
					continue;
				}
				return false;
			}
			return true;
		}

		public static bool smethod_6(this MouseEvent mouseEvent_0, PopupActivationMode popupActivationMode_0)
		{
			return popupActivationMode_0 switch
			{
				PopupActivationMode.LeftClick => mouseEvent_0 == MouseEvent.IconLeftMouseUp, 
				PopupActivationMode.RightClick => mouseEvent_0 == MouseEvent.IconRightMouseUp, 
				PopupActivationMode.DoubleClick => mouseEvent_0.smethod_5(MouseEvent.IconDoubleClick), 
				PopupActivationMode.LeftOrRightClick => mouseEvent_0.smethod_5(MouseEvent.IconLeftMouseUp, MouseEvent.IconRightMouseUp), 
				PopupActivationMode.LeftOrDoubleClick => mouseEvent_0.smethod_5(MouseEvent.IconLeftMouseUp, MouseEvent.IconDoubleClick), 
				PopupActivationMode.MiddleClick => mouseEvent_0 == MouseEvent.IconMiddleMouseUp, 
				PopupActivationMode.All => mouseEvent_0 != MouseEvent.MouseMove, 
				_ => throw new ArgumentOutOfRangeException("activationMode"), 
			};
		}

		public static void smethod_7(this ICommand icommand_0, object object_1, IInputElement iinputElement_0)
		{
			if (icommand_0 == null)
			{
				return;
			}
			RoutedCommand routedCommand = icommand_0 as RoutedCommand;
			if (routedCommand != null)
			{
				if (routedCommand.CanExecute(object_1, iinputElement_0))
				{
					routedCommand.Execute(object_1, iinputElement_0);
				}
			}
			else if (icommand_0.CanExecute(object_1))
			{
				icommand_0.Execute(object_1);
			}
		}

		public static bool smethod_8(this FrameworkElement frameworkElement_0)
		{
			if (frameworkElement_0 == null)
			{
				throw new ArgumentNullException("element");
			}
			return frameworkElement_0.GetBindingExpression(FrameworkElement.DataContextProperty) != null;
		}
	}
}
